package com.yhb.channel;

import com.yhb.channel.exception.PayChannelException;
import com.yhb.channel.impl.ANYPAY.AnyPayDHL09Channel;
import com.yhb.channel.impl.ANYPAY.AnyPayDHLChannel;
import com.yhb.channel.impl.ANYPAY.AnyPayTXChannel;
import com.yhb.channel.impl.BJCJ.BJCJChannel;
import com.yhb.channel.impl.BJCJ.BJCJSubChannelFactory;
import com.yhb.channel.impl.Scalable.ScalableChannel;
import com.yhb.channel.impl.Scalable.ScalableChannelFactory;
import com.yhb.channel.model.IBankCard;
import com.yhb.channel.model.SubChannelInfo;
import com.yhb.channel.utils.BlackVerifier;
import com.yhb.channel.utils.ChannelDateUtil;
import com.yhb.channel.utils.UnionCardVerifier;
import com.yhb.channel.utils.WhiteListVerifier;
import com.yhb.model.Card;
import lombok.Getter;
import lombok.extern.log4j.Log4j;
import lombok.var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Service
@Log4j
public class SubChannelInfoList {
    @Autowired
    private BJCJSubChannelFactory bjcjSubChannelFactory;

    @Autowired
    private ScalableChannelFactory scalableChannelFactory;

    public BJCJChannel largeChannel11;
    public BJCJChannel largeChannel12;
    public BJCJChannel largeChannel13;
    public BJCJChannel largeChannel14;
    public BJCJChannel largeChannel18;

    // 商盟大额DH
    public ScalableChannel shangMengDHL02;
    public ScalableChannel shangMengDHL03;
    public ScalableChannel shangMengDHL04;
    public ScalableChannel shangMengDHL05;
    public ScalableChannel shangMengDHL06;
    public ScalableChannel shangMengDHL07;
    public ScalableChannel shangMengDHL08;

    // ZYF好还通道
    public ScalableChannel FFQ_DHL_19;
    public ScalableChannel FFQ_DHL_20;
    public ScalableChannel FFQ_DHL_21;
    public ScalableChannel FFQ_DHL_22;
    public ScalableChannel FFQ_DHL_23;
    public ScalableChannel FFQ_DHL_24;
    public ScalableChannel FFQ_DHL_25;
    public ScalableChannel FFQ_DHL_26;
    public ScalableChannel FFQ_DHL_27;
    public ScalableChannel LBK_DHL_43;
    public ScalableChannel LBK_DHL_44;
    public ScalableChannel ZYF_DHL_47;
    public ScalableChannel ZYF_DHL_48;


    // YLN快收通道
    public ScalableChannel YLN_TXL_02;
    public ScalableChannel YLN_TXL_03;
    public ScalableChannel YLN_TXL_04;
    public ScalableChannel YLN_TXL_05;
    public ScalableChannel LBS_TXL_06;
    public ScalableChannel TFT_TXL_07;
    public ScalableChannel TFT_TXL_08;
    public ScalableChannel TFT_TXL_09;
    public ScalableChannel TFT_TXL_10;
    public ScalableChannel TFT_TXL_11;
    public ScalableChannel TFT_TXL_12;
    public ScalableChannel TFT_TXL_13;
    public ScalableChannel ZYB_TXL_14;
    public ScalableChannel ZYB_TXL_15;
    public ScalableChannel ZYB_TXL_16;
    public ScalableChannel ZYB_TXL_17;
    public ScalableChannel ZYB_TXL_18;
    public ScalableChannel ZYB_TXL_19;
    public ScalableChannel ZYB_TXL_20;
    public ScalableChannel ZYB_TXL_21;
    public ScalableChannel ZYB_TXL_22;

    @Getter
    private List<SubChannelInfo> subChannelInfos;

    @Autowired
    public ChannelFactory channelFactory;

    private void initBJCJChannel() {
        largeChannel11 = bjcjSubChannelFactory.getSubChannel("LARGE_CHANNEL11");
        largeChannel12 = bjcjSubChannelFactory.getSubChannel("LARGE_CHANNEL12");
        largeChannel13 = bjcjSubChannelFactory.getSubChannel("LARGE_CHANNEL13");
        largeChannel14 = bjcjSubChannelFactory.getSubChannel("LARGE_CHANNEL14");
        largeChannel18 = bjcjSubChannelFactory.getSubChannel("LARGE_CHANNEL18");
    }

    private void initScalableChannel() {
        shangMengDHL02 = scalableChannelFactory.getSubChannel("SHANGMENG-DHL02");
        shangMengDHL03 = scalableChannelFactory.getSubChannel("SHANGMENG-DHL03");
        shangMengDHL04 = scalableChannelFactory.getSubChannel("SHANGMENG-DHL04");
        shangMengDHL05 = scalableChannelFactory.getSubChannel("SHANGMENG-DHL05");
        shangMengDHL06 = scalableChannelFactory.getSubChannel("SHANGMENG-DHL06");
        shangMengDHL07 = scalableChannelFactory.getSubChannel("SHANGMENG-DHL07");
        shangMengDHL08 = scalableChannelFactory.getSubChannel("SHANGMENG-DHL08");

        FFQ_DHL_19 = scalableChannelFactory.getSubChannel("FFQ-DHL19");
        FFQ_DHL_20 = scalableChannelFactory.getSubChannel("FFQ-DHL20");
        FFQ_DHL_21 = scalableChannelFactory.getSubChannel("FFQ-DHL21");
        FFQ_DHL_22 = scalableChannelFactory.getSubChannel("FFQ-DHL22");
        FFQ_DHL_23 = scalableChannelFactory.getSubChannel("FFQ-DHL23");
        FFQ_DHL_24 = scalableChannelFactory.getSubChannel("FFQ-DHL24");
        FFQ_DHL_25 = scalableChannelFactory.getSubChannel("FFQ-DHL25");
        FFQ_DHL_26 = scalableChannelFactory.getSubChannel("FFQ-DHL26");
        FFQ_DHL_27 = scalableChannelFactory.getSubChannel("FFQ-DHL27");
        LBK_DHL_43 = scalableChannelFactory.getSubChannel("LBK-DHL43");
        LBK_DHL_44 = scalableChannelFactory.getSubChannel("LBK-DHL44");
        ZYF_DHL_47 = scalableChannelFactory.getSubChannel("ZYF-DHL47");
        ZYF_DHL_48 = scalableChannelFactory.getSubChannel("ZYF-DHL48");

        YLN_TXL_02 = scalableChannelFactory.getSubChannel("YLN-TXL02");
        YLN_TXL_03 = scalableChannelFactory.getSubChannel("YLN-TXL03");
        YLN_TXL_04 = scalableChannelFactory.getSubChannel("YLN-TXL04");
        YLN_TXL_05 = scalableChannelFactory.getSubChannel("YLN-TXL05");
        LBS_TXL_06 = scalableChannelFactory.getSubChannel("LBS-TXL06");
        TFT_TXL_07 = scalableChannelFactory.getSubChannel("TFT-TXL07");
        TFT_TXL_08 = scalableChannelFactory.getSubChannel("TFT-TXL08");
        TFT_TXL_09 = scalableChannelFactory.getSubChannel("TFT-TXL09");
        TFT_TXL_10 = scalableChannelFactory.getSubChannel("TFT-TXL10");
        TFT_TXL_11 = scalableChannelFactory.getSubChannel("TFT-TXL11");
        TFT_TXL_12 = scalableChannelFactory.getSubChannel("TFT-TXL12");
        TFT_TXL_13 = scalableChannelFactory.getSubChannel("TFT-TXL13");
        ZYB_TXL_14 = scalableChannelFactory.getSubChannel("ZYB-TXL14");
        ZYB_TXL_15 = scalableChannelFactory.getSubChannel("ZYB-TXL15");
        ZYB_TXL_16 = scalableChannelFactory.getSubChannel("ZYB-TXL15");
        ZYB_TXL_17 = scalableChannelFactory.getSubChannel("ZYB-TXL17");
        ZYB_TXL_18 = scalableChannelFactory.getSubChannel("ZYB-TXL18");
        ZYB_TXL_19 = scalableChannelFactory.getSubChannel("ZYB-TXL19");
        ZYB_TXL_20 = scalableChannelFactory.getSubChannel("ZYB-TXL20");
        ZYB_TXL_21 = scalableChannelFactory.getSubChannel("ZYB-TXL21");
        ZYB_TXL_22 = scalableChannelFactory.getSubChannel("ZYB-TXL22");
    }

    /** 启动方法 */
    @PostConstruct
    private void init() {
        this.initBJCJChannel();
        this.initScalableChannel();
        subChannelInfos = Arrays.asList(
                // 商盟
                SubChannelInfo.builder()
                        .channelName(shangMengDHL02.channelFullName)
                        .channelType(shangMengDHL02.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(shangMengDHL02)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(shangMengDHL03.channelFullName)
                        .channelType(shangMengDHL03.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(shangMengDHL03)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(shangMengDHL04.channelFullName)
                        .channelType(shangMengDHL04.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(shangMengDHL04)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(shangMengDHL05.channelFullName)
                        .channelType(shangMengDHL05.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(shangMengDHL05)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(shangMengDHL06.channelFullName)
                        .channelType(shangMengDHL06.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(shangMengDHL06)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(shangMengDHL07.channelFullName)
                        .channelType(shangMengDHL07.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(shangMengDHL07)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(shangMengDHL08.channelFullName)
                        .channelType(shangMengDHL08.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(shangMengDHL08)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),


                // ZYF好还通道
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_19.channelFullName)
                        .channelType(FFQ_DHL_19.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_19)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_20.channelFullName)
                        .channelType(FFQ_DHL_20.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_20)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_21.channelFullName)
                        .channelType(FFQ_DHL_21.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_21)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_22.channelFullName)
                        .channelType(FFQ_DHL_22.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_22)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_23.channelFullName)
                        .channelType(FFQ_DHL_23.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_23)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_24.channelFullName)
                        .channelType(FFQ_DHL_24.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_24)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_25.channelFullName)
                        .channelType(FFQ_DHL_25.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_25)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_26.channelFullName)
                        .channelType(FFQ_DHL_26.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_26)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(FFQ_DHL_27.channelFullName)
                        .channelType(FFQ_DHL_27.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(FFQ_DHL_27)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(LBK_DHL_43.channelFullName)
                        .channelType(LBK_DHL_43.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(LBK_DHL_43)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(LBK_DHL_44.channelFullName)
                        .channelType(LBK_DHL_44.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(LBK_DHL_44)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYF_DHL_47.channelFullName)
                        .channelType(ZYF_DHL_47.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(ZYF_DHL_47)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYF_DHL_48.channelFullName)
                        .channelType(ZYF_DHL_48.channelFullType)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 好还不进轮询 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(ZYF_DHL_48)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                // YLN快收通道
                SubChannelInfo.builder()
                        .channelName(YLN_TXL_02.channelFullName)
                        .channelType(YLN_TXL_02.channelFullType)
                        .debitCostRate(32)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(YLN_TXL_02)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(YLN_TXL_03.channelFullName)
                        .channelType(YLN_TXL_03.channelFullType)
                        .debitCostRate(35)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(YLN_TXL_03)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(YLN_TXL_04.channelFullName)
                        .channelType(YLN_TXL_04.channelFullType)
                        .debitCostRate(44)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(YLN_TXL_04)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(YLN_TXL_05.channelFullName)
                        .channelType(YLN_TXL_05.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(YLN_TXL_05)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(LBS_TXL_06.channelFullName)
                        .channelType(LBS_TXL_06.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(LBS_TXL_06)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(TFT_TXL_07.channelFullName)
                        .channelType(TFT_TXL_07.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(TFT_TXL_07)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(TFT_TXL_08.channelFullName)
                        .channelType(TFT_TXL_08.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(TFT_TXL_08)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(TFT_TXL_09.channelFullName)
                        .channelType(TFT_TXL_09.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(TFT_TXL_09)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(TFT_TXL_10.channelFullName)
                        .channelType(TFT_TXL_10.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(TFT_TXL_10)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(TFT_TXL_11.channelFullName)
                        .channelType(TFT_TXL_11.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(TFT_TXL_11)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(TFT_TXL_12.channelFullName)
                        .channelType(TFT_TXL_12.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(TFT_TXL_12)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(TFT_TXL_13.channelFullName)
                        .channelType(TFT_TXL_13.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(TFT_TXL_13)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_14.channelFullName)
                        .channelType(ZYB_TXL_14.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_14)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_15.channelFullName)
                        .channelType(ZYB_TXL_15.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_15)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_16.channelFullName)
                        .channelType(ZYB_TXL_16.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_16)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_17.channelFullName)
                        .channelType(ZYB_TXL_17.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_17)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_18.channelFullName)
                        .channelType(ZYB_TXL_18.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_18)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_19.channelFullName)
                        .channelType(ZYB_TXL_19.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_19)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_20.channelFullName)
                        .channelType(ZYB_TXL_20.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_20)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_21.channelFullName)
                        .channelType(ZYB_TXL_21.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_21)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),
                SubChannelInfo.builder()
                        .channelName(ZYB_TXL_22.channelFullName)
                        .channelType(ZYB_TXL_22.channelFullType)
                        .debitCostRate(46)
                        .creditCostRate(50)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(ZYB_TXL_22)
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(false)
                        .close(false)
                        .build(),


                // anypay大额dh通道
                SubChannelInfo.builder()
                        .channelName(AnyPayDHLChannel.CHANNEL_NAME)
                        .channelType(AnyPayDHLChannel.CHANNEL_TYPE)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(channelFactory.getChannelByType(AnyPayDHLChannel.CHANNEL_TYPE))
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                // anypay大额dh09通道
                SubChannelInfo.builder()
                        .channelName(AnyPayDHL09Channel.CHANNEL_NAME)
                        .channelType(AnyPayDHL09Channel.CHANNEL_TYPE)
                        .debitCostRate(9999)
                        .creditCostRate(9999)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of()) // 不允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(channelFactory.getChannelByType(AnyPayDHL09Channel.CHANNEL_TYPE))
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(false)
                        .close(true)
                        .build(),
                // anypay大额tx通道
                SubChannelInfo.builder()
                        .channelName(AnyPayTXChannel.CHANNEL_NAME)
                        .channelType(AnyPayTXChannel.CHANNEL_TYPE)
                        .debitCostRate(48)
                        .creditCostRate(48)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(6, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(20, 59))
                        .payCardVerifier(BlackVerifier.of()) // 允许一切银行
                        .remitCardVerifier(UnionCardVerifier.getInstance())  // 允许一切储蓄卡
                        .payChannel(channelFactory.getChannelByType(AnyPayTXChannel.CHANNEL_TYPE))
                        .supportDebitCardAsPayCard(false)
                        .noNeedQueryBalance(true)
                        .close(true)
                        .build(),
                // 畅捷LARGE_CHANNEL11
                SubChannelInfo.builder()
                        .channelName(largeChannel11.channelFullName)
                        .channelType(largeChannel11.channelFullType)
                        .debitCostRate(31)
                        .creditCostRate(31)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of("南京银行","恒丰银行","杭州银行","浙商银行"))
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(largeChannel11)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(true) // todo 畅捷维护结束后改成false
                        .close(true)
                        .build(),
                // 畅捷LARGE_CHANNEL12
                SubChannelInfo.builder()
                        .channelName(largeChannel12.channelFullName)
                        .channelType(largeChannel12.channelFullType)
                        .debitCostRate(40)
                        .creditCostRate(40)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of("建设银行", "中国建设银行", "上海银行", "北京银行", "中国银行"))
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(largeChannel12)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(true)
                        .close(true)
                        .build(),
                // 畅捷LARGE_CHANNEL13
                SubChannelInfo.builder()
                        .channelName(largeChannel13.channelFullName)
                        .channelType(largeChannel13.channelFullType)
                        .debitCostRate(45)
                        .creditCostRate(45)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .limitPerFlow(BigDecimal.valueOf(20000L))
                        .payCardVerifier(WhiteListVerifier.of("平安银行", "广发银行", "广东发展银行", "中信银行", "工商银行", "中国工商银行"))
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(largeChannel13)
                        .supportDebitCardAsPayCard(true)
                        .noNeedQueryBalance(true)
                        .close(true)
                        .build(),
                // 畅捷LARGE_CHANNEL14
                SubChannelInfo.builder()
                        .channelName(largeChannel14.channelFullName)
                        .channelType(largeChannel14.channelFullType)
                        .debitCostRate(55)
                        .creditCostRate(55)
                        .degreeOfPreference(0)
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of("光大银行", "浦发银行", "上海浦东发展银行",
                                "兴业银行", "民生银行", "中国民生银行", "农业银行", "招商银行"))
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(largeChannel14)
                        .noNeedQueryBalance(true)
                        .supportDebitCardAsPayCard(true)
                        .close(true)
                        .build(),
                // 畅捷LARGE_CHANNEL18
                SubChannelInfo.builder()
                        .channelName(largeChannel18.channelFullName)
                        .channelType(largeChannel18.channelFullType)
                        .debitCostRate(31)
                        .creditCostRate(46)
                        .degreeOfPreference(0)
                        .noNeedQueryBalance(true) // todo 畅捷维护结束后改成false
                        .payStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(7, 0))
                        .payEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(22, 59))
                        .remitStartTime(ChannelDateUtil.getNewYearsDayTimeCalendar(0, 0))
                        .remitEndTime(ChannelDateUtil.getNewYearsDayTimeCalendar(23, 59))
                        .payCardVerifier(WhiteListVerifier.of("光大银行", "招商银行", "中信银行", "工商银行", "中国银行",
                                "上海银行", "浦发银行", "上海浦东发展银行", "兴业银行", "邮政储蓄", "中国邮政储蓄银行", "农业银行", "平安银行", "华夏银行",
                                "北京银行", "民生银行", "中国民生银行", "广发银行", "广东发展银行", "中国工商银行", "中国农业银行"))
                        .remitCardVerifier(UnionCardVerifier.getInstance())
                        .payChannel(largeChannel18)
                        .supportDebitCardAsPayCard(false)
                        .close(true)
                        .build()
        );
    }

    /**
     * 获取全部通道信息
     * @return 通道信息列表
     */
    public SubChannelInfo[] getFullChannelList() {
        return this.subChannelInfos.toArray(new SubChannelInfo[0]);
    }

    /**
     * 获取已经排序过的支付通道列表
     * @param payCard 支付卡
     * @param remitCard 代付卡
     * @param orderAmount 金额
     * @return 支付通道列表
     */
    PayChannel[] getChannelList(IBankCard payCard, IBankCard remitCard, BigDecimal orderAmount) {
        var result = getChannelInfoList(payCard, remitCard, orderAmount);
        return Arrays.stream(result).map(SubChannelInfo::getPayChannel).toArray(PayChannel[]::new);
    }


    void noChannelToUse(String reason) {
        var t = new PayChannelException(ChannelConstant.EMPTY_CHANNEL_LIST, reason);
        log.error("getChannelInfoList", t);
        throw t;
    }

    /**
     * 获取排序后的符合条件的SubChannelInfo对象列表
     * @param payCard 支付卡
     * @param remitCard 代付卡
     * @param orderAmount 金额
     * @return SubChannelInfo对象列表
     */
    SubChannelInfo[] getChannelInfoList(IBankCard payCard, IBankCard remitCard, BigDecimal orderAmount) {
        var openList = subChannelInfos.parallelStream().filter(
                subChannelInfo -> !subChannelInfo.isClose()
        ).collect(Collectors.toList());
        if (openList.size() == 0) {
            noChannelToUse("所有通道均在维护");
        }
        // 过滤金额
        var amountOkList = openList.parallelStream().filter(
                subChannelInfo -> subChannelInfo.isAmountOk(orderAmount)
        ).collect(Collectors.toList());
        if (amountOkList.size() == 0) {
            noChannelToUse("金额不支持");
        }

        // 过滤时间
        var amountAndTimeOkList = amountOkList.parallelStream().filter(
                SubChannelInfo::isNowOk
        ).collect(Collectors.toList());
        if (amountAndTimeOkList.size() == 0) {
            noChannelToUse("支付时间不支持");
        }

        // 过滤银行卡
        var amountAndTimeAndBankOkList = amountAndTimeOkList.parallelStream().filter(
                subChannelInfo -> subChannelInfo.isBanksOk(payCard, remitCard)
        ).collect(Collectors.toList());
        if (amountAndTimeAndBankOkList.size() == 0) {
            noChannelToUse("银行卡不支持");
        }

        // 过滤不支持支付卡是储蓄卡的情况
        var allOkList = amountAndTimeAndBankOkList.parallelStream().filter(
                subChannelInfo -> subChannelInfo.isPayCardOk(payCard)
        ).collect(Collectors.toList());
        if (allOkList.size() == 0) {
            noChannelToUse("支付卡不支持");
        }

        var result = allOkList.toArray(new SubChannelInfo[0]);
        Arrays.sort(result);
        return result;
    }

    public static void main(String[] args) {
        SubChannelInfoList list = new SubChannelInfoList();
        list.init();
        System.out.println(Arrays.toString(list.getChannelList(
                Card.builder().bankName("中国银行").build(),
                Card.builder().bankName("中国银行").build(),
                BigDecimal.valueOf(999L)
        )));
    }
}
